﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesertKharonIrcPlugin
{
    public static class ColorExtensionMethods
    {
        public static uint ToUint(this Color color)
        {
            return (uint)(((color.A << 24) | (color.R << 16) | (color.G << 8) | color.B) & 0xffffffffL);
        }

        public static Color ToColor(this uint value)
        {
            return Color.FromArgb((byte)((value >> 24) & 0xFF),
                       (byte)((value >> 16) & 0xFF),
                       (byte)((value >> 8) & 0xFF),
                       (byte)(value & 0xFF));
        }
    }
}
